﻿using FluentValidation;
using Mes.Application.DTO.Inputs.Quality;
using Mes.Application.DTO.Inputs.WorkOrders;

namespace Mes.Application.Web.Validators.Quality
{
    public class AddingSampleFreqInputValidator : AbstractValidator<AddingSampleFreqInput>
    {
        public AddingSampleFreqInputValidator()
        {
            RuleFor(x => x.Freq_Name).Length(1, 40).WithMessage("采样计划频率名称长度必须在1到40之间");
            RuleFor(x => x.Freq_Desc).Length(0, 80).WithMessage("采样计划频率描述长度必须在0到80之间");
            RuleFor(x => x.Spare1).Length(0, 80).WithMessage("备用字段1长度必须在0到80之间");
            RuleFor(x => x.Spare2).Length(0, 80).WithMessage("备用字段2长度必须在0到80之间");
            RuleFor(x => x.Spare3).Length(0, 80).WithMessage("备用字段3长度必须在0到80之间");
            RuleFor(x => x.Spare4).Length(0, 80).WithMessage("备用字段4长度必须在0到80之间");
        }
    }
}
